(function(angular) {
	'use strict';
	angular.module("fs.waf").factory("transactionService", transactionService);
	transactionService.$inject = [ '$q', 'loggerFactory', 'ajaxServiceFactory'];
	function transactionService($q, loggerFactory, ajaxServiceFactory) {
		var log = loggerFactory.getLogger("transactionService");
		var ajaxService = ajaxServiceFactory.buildAjaxService({
			getDropDownDataOptions:{
				url : 'do/cda/txn/dropDownDataOptions',
				method : 'get'
		    },
		    getFilterDatas:{
		    	url : 'do/cda/txn/dataFilter',
				method : 'get'
		    }
		});
		
		
		function dataFilter(){
			var defer = $q.defer();
			var object ={};
			ajaxService.getFilterDatas().then(function(response) {
				if(response && response.data){
				   object.transactionStatusFilter=response.data.txnStatus;
				   object.transactionActionFilter=response.data.actionStatus;
				   object.transactionPayFilter=response.data.payStatus;
				}
				defer.resolve(object);
			});
			return defer.promise;
		};
		
		function getTxnStatus(){
			var defer = $q.defer();
			ajaxService.getDropDownDataOptions().then(function(response) {
				var object ={};
				if(response && response.data){
				    // get transactionStatusOptions
				   object.txnStatus = response.data.txnStatus;
				   
				   // get transactionPayOptions
				   object.payStatus = response.data.payStatus;
				   
				   // get txnCcyOptions
				   object.txnCcys = response.data.txnCcy;
				}
				defer.resolve(object);
			});
			return defer.promise;
		}
	
		
		return {
			dataFilter : dataFilter,
			getTxnStatus : getTxnStatus
		};
	}
})(angular);